package com.demo.observer;

import com.demo.dto.MessageDTo;
import com.demo.utils.MsgFactory;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author oyz
 */
@Component
public class SunObserver extends AbstractObserver{


    @PostConstruct
    public void init(){
        MsgFactory.OBSERVER_LIST.add(this);
    }

    @Override
    public void handle(MessageDTo messageDTo) {
        System.out.println("孙看见消息了...");
    }
}
